package com.livestocksolutions.ui;

import com.livestocksolutions.R;
import com.livestocksolutions.intent.BaseActivity;

import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

public class ListLocationPaddockArrayAdapter extends ViewLocationPaddockArrayAdapter {
	/**
	 * Constructor
	 * @param context The current context.
	 * @param values The Paddock/Location to represent in the ListView.
	 */
	public ListLocationPaddockArrayAdapter(BaseActivity context, String[][] values) {
		super(context, values);
	}
	
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		final View rowView = super.setView(position, convertView, parent);
		
		TextView paddock = (TextView) rowView.findViewById(R.id.locationName);
		TextView description = (TextView) rowView.findViewById(R.id.locationDescription);

		paddock.setText(values[position][NAME]);
		description.setText(values[position][DESCRIPTION]);
		return rowView;
	}
}
